package cc.coolplay51.fakashop3.DO;

import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import java.util.Objects;

/**
 * @Classname SystemSetting
 * @Description TODO
 * @Date 2021/4/16 11:19
 * @Created by 涂海龙
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@Entity
@ToString
public class SystemSetting {
    @Id
    private String name;
    @Column(nullable = false)
    private String value;
    @Column
    private Boolean outRead;

    @PrePersist
    public void WriteDefault(){
        if(Objects.isNull(outRead)){
            setOutRead(true);
        }
    }
}
